package com.lemobar.pay.model.wxpay.request;

import lombok.Data;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

/**
 * 微信申请退款 请求参数
 * JSAPI支付 https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_4
 * 小程序支付 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=9_4
 * APP支付  https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=9_4&index=6
 * 付款码支付 https://pay.weixin.qq.com/wiki/doc/api/micropay.php?chapter=9_4
 */
@Data
@Root(name = "xml", strict = false)
public class WxPayRefundRequest {

    @Element(name = "appid")
    private String appid;

    @Element(name = "mch_id")
    private String mchId;

    @Element(name = "nonce_str")
    private String nonceStr;

    @Element(name = "sign")
    private String sign;

    /**
     * 签名类型
     * 目前支持HMAC-SHA256和MD5，默认为MD5
     */
    @Element(name = "sign_type", required = false)
    private String signType;

    /**
     * 微信支付订单号
     */
    @Element(name = "transaction_id", required = false)
    private String transactionId;

    /**
     * 商户订单号
     */
    @Element(name = "out_trade_no", required = false)
    private String outTradeNo;

    /**
     * 商户退款单号
     */
    @Element(name = "out_refund_no")
    private String outRefundNo;

    /**
     * 订单总金额
     * 单位为分，只能为整数
     */
    @Element(name = "total_fee")
    private Integer totalFee;

    /**
     * 退款总金额
     * 单位为分，只能为整数
     */
    @Element(name = "refund_fee")
    private Integer refundFee;

    /**
     * 退款货币种类
     * 需与支付一致，或者不填。符合ISO 4217标准的三位字母代码，默认人民币：CNY
     */
    @Element(name = "refund_fee_type", required = false)
    private String refundFeeType;

    /**
     * 退款原因
     * 商户传入，会在下发给用户的退款消息中体现退款原因
     */
    @Element(name = "refund_desc", required = false)
    private String refundDesc;

    /**
     * 退款资金来源
     * 仅针对老资金流商户使用
     *  REFUND_SOURCE_UNSETTLED_FUNDS---未结算资金退款（默认使用未结算资金退款）
     *  REFUND_SOURCE_RECHARGE_FUNDS---可用余额退款
     */
    @Element(name = "refund_account", required = false)
    private String refundAccount;

    /**
     * 退款结果通知url
     * 如果参数中传了 notify_url，则商户平台上配置的回调地址将不会生效。
     */
    @Element(name = "notify_url", required = false)
    private String notifyUrl;

}
